<template>
  <div class="getBox">
    <van-button type="primary" @click="get">发送get请求</van-button>
    <hr />
    <van-button type="primary" @click="post">发送post请求</van-button>
  </div>
</template>

<script>
export default {
  name: 'GetComponent',
  methods: {
    async get() {
      const { data: req } = await this.$http.get('/test')
      console.log(req)
    },
    async post() {
      const { data: req } = await this.$http.post('/testPostData', {
        name: 'zhangsan',
        sex: '女',
        age: 18
      })
      console.log(req)
    }
  }
}
</script>

<style></style>
